<template>
  <!-- 出勤 -->
  <div class="Attendance">
    <div class="nav">
      <div class="check" @click="Apply">申请</div>
    </div>
    <div class="body">
      <template>
        <el-table :data="tableData" style="width: 100%" height="631" stripe>
          <el-table-column type="index" label="序号" align="center" width="100"></el-table-column>
          <el-table-column prop="createOnStr" label="申请时间" align="center"></el-table-column>
          <el-table-column prop="position" label="招聘岗位" align="center"></el-table-column>
          <el-table-column prop="amount" label="招聘人数" align="center"></el-table-column>
          <el-table-column prop="department" label="申请部门" align="center"></el-table-column>
          <el-table-column prop="name" label="申请人" align="center"></el-table-column>
          <el-table-column prop="state" label="状态" align="center"></el-table-column>
          <el-table-column prop="f" label="操作" align="center">
            <el-row slot-scope="scope">
              <el-button size="mini" type="primary" @click="xq(scope.row.id)">详情</el-button>
            </el-row>
          </el-table-column>
        </el-table>
      </template>
    </div>
    <template>
      <el-pagination
        background
        layout="prev, pager, next"
        :total="total"
        :current-page="current"
        :page-size="pagesize"
        @current-change="handleCurrentChange"
      ></el-pagination>
    </template>
  </div>
</template>

<script>
import axios from "axios";
export default {
  components: {},
  computed: {},
  data () {
    return {
      tableData: [],
      total: 1,
      current: 1,
      pagesize: 10,
      creater: 0,
    };
  },
  created () {
    this.creater = JSON.parse(localStorage.getItem("message")).Id;
    this.getwageslist(0);
  },
  methods: {
    //列表数据
    getwageslist (page) {
      let obj = {
        creater: this.creater,
        pn: page,
        PerPageSize: this.pagesize
      };
      var objs = JSON.stringify(obj);
      let the = { index: 23, jsondata: objs }
      axios.post("/apis/MyCenter.asmx/GetData", the).then(({ data }) => {
        var list = eval('(' + data.d + ')');
        this.total = list.count;
        this.tableData = list.data;
      });
    },
    //详情
    xq (e) {
      this.$router.push({ path: "./Recruitment", query: { e: e } });
    },
    Apply (e, paixu, shows) {
      this.$router.push({ path: "./Recruitment", query: { e: 0 } });
    },
    // 分页
    handleCurrentChange (e) {
      this.getData(e - 1);
    }
  }
};
</script>

<style lang="scss" scoped>
@import '@/assets/scss/base.scss';
.Attendance {
  width: 99%;
  // border: 1px solid #000;
}
.nav {
  text-align: center;
  display: flex;
  position: relative;
  background-color: $white;
  height: 120px;
  width: 99%;
  margin-left: 15px;
  margin-top: 15px;
  font-weight: bold;
}
.nav .nav_left {
  margin-top: 35px;
}
.nav .nav_right {
  border: none;
}
.check {
  height: 105px;
  width: 99%;
  margin-left: 90%;
  // margin-top: -115px;
  margin-top: 5px;
  line-height: 100px;
  border-radius: 5px;
  color: $Personnel;
  font-weight: bold;
  border: solid 1px $Personnel;
  cursor: pointer;
  text-align: center;
  background-color: #e9eefa;
  font-size: 18px;
}
.body {
  width: 99%;
  margin-top: 20px;
  margin-left: 15px;
  // border: 1px solid red;
}
.el-pagination {
  margin-top: 15px;
  text-align: center;
}
</style>
<style >
/* 
.el-table td, .el-table th{
  padding: 6px 0;
} */
</style>